typedef unsigned char byte; /* from linux/ide.h */
-#define XLBLK_MAX 32
-
#define XLBLK_RESPONSE_IRQ _EVENT_BLK_RESP
#define DEBUG_IRQ _EVENT_DEBUG
#define DPRINTK_IOCTL(_f, _a...) ((void)0)
#endif
-/* IDE/SCSI have <= 32 partitions per device. VIRT has <= 16. */
-#define PARTN_SHIFT(_dev) ((MAJOR(_dev)==XLVIRT_MAJOR) ? 4 : 5)
-#define XLIDE_PARTN_SHIFT 5
-#define XLSCSI_PARTN_SHIFT 5
+/* XL IDE and SCSI use same major/minor numbers as normal Linux devices. */
+#define XLIDE_MAJOR IDE0_MAJOR
+#define XLSCSI_MAJOR SCSI_DISK0_MAJOR
+
+/* IDE has < 64 partitions per device. VIRT and SCSI have < 16. */
+#define PARTN_SHIFT(_dev) ((MAJOR(_dev)==IDE0_MAJOR) ? 6 : 4)
+#define XLIDE_PARTN_SHIFT 6
+#define XLSCSI_PARTN_SHIFT 4
#define XLVIRT_PARTN_SHIFT 4
+#define XLIDE_DEVS_PER_MAJOR (256 >> XLIDE_PARTN_SHIFT)
+#define XLSCSI_DEVS_PER_MAJOR (256 >> XLSCSI_PARTN_SHIFT)
+#define XLVIRT_DEVS_PER_MAJOR (256 >> XLVIRT_PARTN_SHIFT)
+
/*
* We have one of these per XL-IDE, XL-SCSI, and XL-VIRT device.
* They hang in an array off the gendisk structure. We may end up putting
* xl_ide.c
*
* Xenolinux virtual IDE block-device driver.
- *
*/
#include "xl_block.h"
#define MAJOR_NR XLIDE_MAJOR
#include <linux/blk.h>
-/* We support up to 16 devices of up to 16 partitions each. */
#define XLIDE_MAX 256
-#define XLIDE_MAJOR_NAME "xhd"
+#define XLIDE_MAJOR_NAME "hd"
static int xlide_blksize_size[XLIDE_MAX];
static int xlide_hardsect_size[XLIDE_MAX];
static int xlide_max_sectors[XLIDE_MAX];
units = 0;
for ( i = 0; i < xdi->count; i++ )
if ( IS_IDE_XENDEV(xdi->disks[i].device) &&
- ((xdi->disks[i].device & XENDEV_IDX_MASK) < 16) ) units++;
+ ((xdi->disks[i].device & XENDEV_IDX_MASK) <
+ XLIDE_DEVS_PER_MAJOR) )
+ units++;
if ( units == 0 ) return 0;
SET_MODULE_OWNER(&xlide_block_fops);
minor = disk << XLIDE_PARTN_SHIFT;
- /* We can use the first 16 IDE devices. */
- if ( !IS_IDE_XENDEV(xdi->disks[i].device) || (disk >= 16) ) continue;
+ if ( !IS_IDE_XENDEV(xdi->disks[i].device) ||
+ (disk >= XLIDE_DEVS_PER_MAJOR) )
+ continue;
((xl_disk_t *)gd->real_devices)[disk].capacity =
xdi->disks[i].capacity;
* xl_scsi.c
*
* Xenolinux virtual SCSI block-device driver.
- *
*/
#include "xl_block.h"
#define MAJOR_NR XLSCSI_MAJOR
#include <linux/blk.h>
-/* We support up to 16 devices of up to 16 partitions each. */
#define XLSCSI_MAX 256
-#define XLSCSI_MAJOR_NAME "xsd"
+#define XLSCSI_MAJOR_NAME "sd"
static int xlscsi_blksize_size[XLSCSI_MAX];
static int xlscsi_hardsect_size[XLSCSI_MAX];
static int xlscsi_max_sectors[XLSCSI_MAX];
units = 0;
for ( i = 0; i < xdi->count; i++ )
if ( IS_SCSI_XENDEV(xdi->disks[i].device) &&
- ((xdi->disks[i].device & XENDEV_IDX_MASK) < 16) ) units++;
+ ((xdi->disks[i].device & XENDEV_IDX_MASK) <
+ XLSCSI_DEVS_PER_MAJOR) )
+ units++;
if ( units == 0 ) return 0;
SET_MODULE_OWNER(&xlscsi_block_fops);
{
disk = xdi->disks[i].device & XENDEV_IDX_MASK;
- /* We can use the first 16 IDE devices. */
- if ( !IS_SCSI_XENDEV(xdi->disks[i].device) || (disk >= 16) ) continue;
+ if ( !IS_SCSI_XENDEV(xdi->disks[i].device) ||
+ (disk >= XLSCSI_DEVS_PER_MAJOR) )
+ continue;
((xl_disk_t *)gd->real_devices)[disk].capacity =
xdi->disks[i].capacity;
/* Copied from linux/ide.h */
typedef unsigned char byte;
-/* We support up to 16 devices of up to 16 partitions each. */
#define XLVIRT_MAX 256
#define XLVIRT_MAJOR_NAME "xvd"
static int xlseg_blksize_size[XLVIRT_MAX];
{
disk = xdi->disks[i].device & XENDEV_IDX_MASK;
- /* We can use the first 16 IDE devices. */
- if ( !IS_VIRTUAL_XENDEV(xdi->disks[i].device) || (disk >= 16) )
+ if ( !IS_VIRTUAL_XENDEV(xdi->disks[i].device) ||
+ (disk >= XLVIRT_DEVS_PER_MAJOR) )
continue;
((xl_disk_t *)gd->real_devices)[disk].capacity =
#define UMEM_MAJOR 116 /* http://www.umem.com/ Battery Backed RAM */
/*
- * XLIDE/XLSCSI each support up to 8 devices of <= 32 partitions each.
* XLVIRT supports 16 devices of <= 16 partitions each.
- * eg. xhda == (123, 0), xhdb == (123, 32), ...
- * xsda == (124, 0), xsdb == (124, 32), ...
- * xvda == (125, 0), xvdb == (125, 16), ...
+ * eg. xvda == (125, 0), xvdb == (125, 16), ...
*/
-#define XLIDE_MAJOR 123 /* XenoLinux IDE Device */
-#define XLSCSI_MAJOR 124 /* XenoLinux SCSI Device */
-#define XLVIRT_MAJOR 125 /* XenoLinux Virtual Device */
+#define XLVIRT_MAJOR 125
#define RTF_MAJOR 150
#define RAW_MAJOR 162
{ "ataraid/d14p",0x72E0 },
{ "ataraid/d15p",0x72F0 },
#if defined(CONFIG_XENOLINUX_BLOCK)
- /* XenoLinux IDE Devices */
- { "xhda", 0x7B00 }, { "xhdb", 0x7B20 },
- { "xhdc", 0x7B40 }, { "xhdd", 0x7B60 },
- { "xhde", 0x7B80 }, { "xhdf", 0x7BA0 },
- { "xhdg", 0x7BC0 }, { "xhdh", 0x7BE0 },
- /* Xenolinux SCSI Devices */
- { "xsda", 0x7C00 }, { "xsdb", 0x7C20 },
- { "xsdc", 0x7C40 }, { "xsdd", 0x7C60 },
- { "xsde", 0x7C80 }, { "xsdf", 0x7CA0 },
- { "xsdg", 0x7CC0 }, { "xsdh", 0x7CE0 },
- /* XenoLinux Virtual Devices */
{ "xvda", 0x7D00 }, { "xvdb", 0x7D10 },
{ "xvdc", 0x7D20 }, { "xvdd", 0x7D30 },
{ "xvde", 0x7D40 }, { "xvdf", 0x7D50 },